package com.honglv.pojo.dto;

import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.List;
import java.util.stream.Collectors;

/**
 * @Auther: 生
 * @Date: 2024/04/17/20:53
 * @Description:
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class UpdateRounteDTO {


    private Long id;

    //摘要
    private String summary;


    //路线名
    private String name;

    //景点
    @ApiModelProperty(value = "List of Longs", example = "[value1, value2, value3]")
    private List<Long> attractionsId;

    //介绍
    private String context;

    //图片
    @ApiModelProperty(value = "List of strings", example = "[\"value1\", \"value2\", \"value3\"]")
    private List<String> pictures;

    //城市
    private String city;

    public String getAttractionsId() {
        return String.join(",", attractionsId.stream().map(Object::toString) // 将 Long 型转换为 String 型
                .collect(Collectors.toList()) // 收集结果为 List<String>
        );
    }

    public String getPictures() {
        return String.join(",", pictures);
    }
}
